Skip to content

fix(odf): preserve text after inline elements#3850

Open
March-77 wants to merge 3 commits into
docling-project:mainfrom
March-77:agent/preserve-odf-inline-tail-text
Open

fix(odf): preserve text after inline elements#3850
March-77 wants to merge 3 commits into
docling-project:mainfrom
March-77:agent/preserve-odf-inline-tail-text

Conversation

@March-77

Copy link
Copy Markdown

Description

  • preserve text stored in child tails while traversing ODF inline elements, using the parent formatting for those tails
  • keep line-break and leaf handling from consuming their own tails so text is emitted exactly once
  • add focused ODT and ODP regression coverage for spaces, bookmarks, and line breaks
  • refresh the existing ODT ground truth to include connective prose that was previously dropped

Issue resolved by this Pull Request:
Resolves #3847

Validation

  • Focused backend tests: 27 passed (excluding the existing end-to-end HTML fixture comparison)
  • All six ODF fixtures: Markdown exact, ITXT fuzzy, and JSON fuzzy ground-truth verification passed
  • Changed-file prek hooks: all passed, including Ruff, Ruff format, ty, Tach, and module coverage
  • Repository Ruff, ty, Tach, dprint, and locked dependency checks passed
  • uv build --no-sources passed

The full backend test file retains one pre-existing Windows HTML mismatch for an embedded image in odf_presentation_02.odp; the identical failure was reproduced before this change. The repository-wide max-lines check also retains four pre-existing failures in unrelated files; the changed-file hook passed.

Checklist:

  • Documentation has been updated, if necessary. (No documentation change is needed.)
  • Examples have been added, if necessary. (The regression test provides the executable example.)
  • Tests have been added, if necessary.

@github-actions

Copy link
Copy Markdown
Contributor

DCO Check Passed

Thanks @March-77, all your commits are properly signed off. 🎉

@mergify

mergify Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 2 protections blocking · waiting on 👀 reviews

Protection Waiting on
🔴 Require two reviewer for test updates 👀 reviews
🟢 Enforce conventional commit

🔴 Require two reviewer for test updates

Waiting for

  • #approved-reviews-by >= 2
This rule is failing.

When test data is updated, we require two reviewers

  • #approved-reviews-by >= 2

Show 1 satisfied protection

🟢 Enforce conventional commit

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert)(?:\(.+\))?(!)?:

Signed-off-by: zhangzherui <jerry_@whut.edu.cn>
@March-77
March-77 force-pushed the agent/preserve-odf-inline-tail-text branch from ceb2b55 to ad83b26 Compare July 22, 2026 18:04
@March-77
March-77 marked this pull request as ready for review July 23, 2026 03:37
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
docling/backend/opendocument_backend.py 91.66% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@dolfim-ibm

Copy link
Copy Markdown
Member

@March-77 thanks for your contribution. do you mind resolving the CI issues and update with the latest main such that the conflicts get resolved?

March-77 added 2 commits July 23, 2026 21:17
Signed-off-by: zhangzherui <jerry_@whut.edu.cn>
Signed-off-by: zhangzherui <jerry_@whut.edu.cn>

Copy link
Copy Markdown
Author

Thanks! I’ve updated the branch with the latest main and resolved the conflict.

The CI failure was caused by an accidental trailing newline in the regenerated HTML fixture. The preserved inline tail text itself is intended and is covered by focused ODT/ODP regression tests. The complete ODF backend test file now passes locally (30 passed), and the fast lint/type and DCO checks are passing on the updated head.

The new fork CI and Docs CI runs are currently awaiting maintainer approval.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ODF backend drops text following a <text:s/> inside a <text:span>

2 participants